[SDTEST-3751] Optimize split-aware parallelism planning#60
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 97267de802
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
E2E Test Report: SUCCESSTested by: Shepherd Agent (autonomous QA for Datadog Test Optimization) Test Environment
Results
Test Methodology
Issues FoundNo PR behavior issues found. One local environment issue occurred before testing: Example plan reportExample run reportThis E2E test was performed by Shepherd, autonomous QA for Datadog Test Optimization. |
What
DDTest now chooses the planned parallel runner count by evaluating a number of possible test splits instead of linearly interpolating from saved/skippable time. Now it is possible to plan the test execution more precise because we have statistics for the durations.
The distribution algorithm plans multiple possible splits between minParallelism and maxParallelism and evaluates them based on (in order of priority):
This PR also adds human-readable plan and run reports, printed to stderr by default, so users can understand and debug what DDTest decided. Reports summarize run identity, Datadog feature settings, backend data, planning results, split quality, and worker execution outcome. Reports can be disabled with:
Expected planning report shape:
Expected run report shape:
Why
The previous runner-count calculation could over-provision workers for suites where additional runners did not reduce the slowest runner's estimated wall time. Scoring candidate splits by slowest-runner time, then imbalance, avoids launching workers that would sit idle.
The new reports make the planning decision easier to audit in CI logs. When a split looks surprising, users can see the Datadog settings, available backend data, duration-source coverage, estimated saved time, selected runner count, expected wall time, and imbalance without digging through artifacts or debug logs.
E2E testing
ddtest plan --platform ruby --framework rspec --min-parallelism 2 --max-parallelism 4on a project with weighted runnable test files.+++ DDTest: plan report..testoptimization/runner/parallel-runners.txtand.testoptimization/runner/tests-split/runner-*to confirm the chosen runner count matches the fastest and most even estimated split.ddtest run --platform ruby --framework rspecusing the generated plan artifacts.+++ DDTest: run report.DD_TEST_OPTIMIZATION_RUNNER_REPORT_ENABLED=false.Validation performed:
go test ./internal/runner,go test ./internal/runner -run '^$' -bench BenchmarkCalculateParallelRunners20000TestFiles -benchtime=1x,make test, andmake lint.